﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GnufInputControl.h"
#include "GnufDropdownMenuControl.h"

namespace gnuf {
    class Info;
    class ButtonControl;

    class GNUF_BASE_EXPORT ICheckListControlAdaptationOption
    {
    public:
        virtual ~ICheckListControlAdaptationOption() {}
    };

    class GNUF_BASE_EXPORT ICheckListControlHandler
        : public IDropdownMenuControlHandler
    {
    public:
        virtual const ICheckListControlAdaptationOption*
            onGetListControlAdaptationOption() const { return nullptr; }
    };
    
    class GNUF_BASE_EXPORT CheckListControl
        : public InputControl
    {
        CANNOT_COPY_OR_ASSIGN(CheckListControl)
    public:
        static const EItemType Type;
        CheckListControl(ICheckListControlHandler*, std::vector<gcmp::OwnerPtr< Info >>&, gcmp::OwnerPtr<Info>&, const std::vector<bool>&);
        virtual ~CheckListControl();
        
        void setCurrentStatus(std::vector<bool>);

        const std::vector<gcmp::OwnerPtr< Info >>& getList() { return m_list; }
        const std::vector<bool>& getCheckStatus() const { return m_checkStatus; }
        inline const Info* info() const { return m_info.get(); }

        DropdownMenuControl* dropdownMenuControl() { return m_dropDownMenuControl.get(); }

    private:
        std::vector< gcmp::OwnerPtr< Info > > m_list;
        gcmp::OwnerPtr<Info> m_info;
        gcmp::OwnerPtr<DropdownMenuControl> m_dropDownMenuControl;
        std::vector<bool> m_checkStatus;
    };

}
